package com.wnq.biglucky;

import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.Toast;
import android.widget.VideoView;

public class MainActivity extends Activity implements OnCompletionListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		VideoView _vidPaly = (VideoView) findViewById(R.id.videoView1); 
		_vidPaly.setOnCompletionListener(this);
        Uri _url = Uri.parse("android.resource://com.wnq.biglucky/"+R.drawable.test_1);
        _vidPaly.setVideoURI(_url);
        _vidPaly.start();
		
	}
	
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}


	@Override
	public void onCompletion(MediaPlayer mp) {
		// TODO Auto-generated method stub
		//System.out.println("play was over !!!");
		Toast.makeText(MainActivity.this, "play was over !!!", Toast.LENGTH_LONG).show();
	}

}
